import Mock from 'mockjs';
import test from './test.json';

Mock.mock(/\/mock\/test/, 'get', (opt) => {
    let obj = {};
    let query = decodeURI(opt.url).split('?')[1].split('&');
    query.forEach(str => {
        let q = str.split('=');
        obj[q[0]] = q[1];
    })
    console.log(opt);
    console.log(obj);
    return { code: 200, data: obj };
});